﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Utility.Database
{
    public class Parameter
    {
        #region 成员变量
        private List<Items> _MemberList;
        private int _Count;
        #endregion

        #region 构造函数
        public Parameter()
        {
            this._Count = 0;
            this._MemberList = new List<Items>();
        }
        #endregion

        #region 属性
        #region Count
        public int Count
        {
            get
            {
                return this._Count;
            }
        }
        #endregion

        #region 索引器
        public Items this[int index]
        {
            get
            {
                return this._MemberList[index];
            }
        }
        #endregion
        #endregion

        #region 方法
        #region AddItem
        public void AddItem(string parameterName, string parameterValue)
        {
            Items memberItem = new Items(parameterName, parameterValue);
            this._MemberList.Add(memberItem);
            this._Count++;
        }
        #endregion

        #region Clear
        public void Clear()
        {
            this._MemberList.Clear();
            this._Count = 0;
        }
        #endregion
        #endregion
    }

    public class Items
    {
        #region 成员变量
        private string _Name;
        private string _Value;
        #endregion

        #region 构造函数
        public Items()
        {
            this._Name = "";
            this._Value = "";
        }

        public Items(string name, string value)
        {
            this._Name = name;
            this._Value = value;
        }
        #endregion

        #region 属性
        #region Name
        public string Name
        {
            get
            {
                return this._Name;
            }
            set
            {
                this._Name = value;
            }
        }
        #endregion

        #region Value
        public string Value
        {
            get
            {
                return this._Value;
            }
            set
            {
                this._Value = value;
            }
        }
        #endregion
        #endregion
    }
}
